Store ID: | |
API Token: | |
Checkout ID: | |
Amount: |
Moneris Checkout gives e-commerce merchants a simple and secure way to process payments by integrating a Moneris-hosted payment module into the merchant checkout page.
In order to integrate with Moneris Checkout as a merchant, you must have:
For development, you should have some understanding of the following:
Additionally, for Google Pay™ integration, all your front-end web pages must use the HTTPS protocol.
The first step is to configure your Moneris Checkout page in the Moneris Merchant Resource Center (MRC).
In the initial stage of development, you create a test configuration in the testing MRC.
Once the solution is ready to be deployed to production, you must create a new, separate configuration for the production environment in the production MRC.
The checkout ID is the key value that is generated after the configuration is completed and used within the Preload Request in order to identify the specific Moneris Checkout configuration.
To get the checkout ID and start configuring your page, do the following:
For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:
https://developer.moneris.comThere are other features of the Moneris Checkout page that you can enable using the configurator in the Merchant Resource Center. They include:
You can configure Moneris Checkout to store a cardholder's credentials in the Moneris Vault and receive a token that represents those credentials for use in future transactions. You can also use Moneris Checkout to update the credentials associated with the token.
If you want to tokenize credentials in Moneris Checkout transactions, you select the Tokenize Card option in the Merchant Resource Center. For updating existing tokens, select Vault Update Card
For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:
https://developer.moneris.comWith tokenization enabled, Moneris Checkout also enables you to allow returning customers to select stored payment cards on the payment page. The customer's payment cards need to be already tokenized and stored in the Moneris Vault to be referenced in the Preload request and displayed to the customer when they get to the payment page.
In the Preload request, Moneris Checkout will accept a token composed of up to three pairs of data key and issuer ID, each one representing the cardholder's payment card stored in the Moneris Vault.
For more information about these fields in the Preload, see Preload Request
Several tools to mitigate the risk of fraud are available for transactions in Moneris Checkout, including:
To select which of these tools to use when performing transactions with Moneris Checkout, go to your Moneris Checkout configurator in the Moneris Merchant Resource Center under the Payment Security section.
For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:
If you select Kount as a fraud tool in Moneris Checkout and your company has its own Enterprise service account from Kount, you will need to include your Kount Merchant ID, Kount API Key and Kount Web- site ID when you configure your Moneris Checkoutstore in the Merchant Resource Center.
If you are using Moneris's basic fraud service package and do not have your own Kount enterprise account, you do not require this information.
Moneris Checkout can be configured to automatically proceed with or deny transactions as a result of a risk assessment it makes based on the responses it receives from the selected fraud tools.
When you check the box for auto decision-making, you also can choose whether each fraud tool's ana- lysis will be treated by Moneris as an optional or mandatory factor in the decision to approve or deny the transaction.
This information applies to all fraud tools with the following exception:
You can customize the appearance of the Moneris Checkout window presented to the customer on their web browser, including how much of the browser window will be taken up by Moneris Checkout.
The default sizing behaviour of the Moneris Checkout window is full-screen, i.e., Moneris Checkout fills the entire web page. You can alter this behaviour to present the customer with a windowed view instead.
If you do not use the full-screen option, you must define the size of the <div> for the window ed view. For more information, see 2.3 Preparing Your Client-Side Checkout Page.
You configure the sizing along with other aspects of the Moneris Checkout window in the Merchant Resource Center.
You can configure Moneris Checkout to price goods and services in a variety of foreign currencies, while continuing to receive settlement and reporting in Canadian dollars.
If you want to use Multi-Currency Pricing (MCP) in Moneris Checkout transactions, you can enable the Multi-Currency Pricing option in the Merchant Resource Center. MCP is only available for Visa and Mastercard.
If Multi-Currency Pricing is enabled, the following features are not supported:
For more information, see the Merchant Resource Center documentation available for download on the Moneris developer portal at:
https://developer.moneris.comIn order to prepare your client-side checkout page for interacting with Moneris Checkout, you need to do a few tasks first:
<script src="https://gatewayt.moneris.com/chktv2/js/chkt_v2.00.js">
Production<script src="https://gateway.moneris.com/chktv2/js/chkt_v2.00.js">
<div id="monerisCheckout"></div>
(Optional): If you are not using the "Full screen" window sizing option, you will need to define the size of your window by creating another <div> around this one, for example:<div id="outerDiv" style="width:400px"; height"300px"> <div id="monerisCheckout"></div></div>
var myCheckout = new monerisCheckout();
myCheckout.setMode("qa");
myCheckout.setCheckoutDiv("monerisCheckout");
var myCheckout = new monerisCheckout();
myCheckout.setCallback("page_loaded", myPageLoad);
myCheckout.setCallback("cancel_transaction", myCancelTransaction);
myCheckout.setCallback("error_event", myErrorEvent);
myCheckout.setCallback("payment_receipt", myPaymentReceipt);
myCheckout.setCallback("payment_complete", myPaymentComplete);
The Preload request is the means by which a Moneris Checkout instance is securely generated at transaction time. It involves a server-to-server post using the JSON format.
The response to the Preload request returns a ticket number which uniquely identifies the instance and must be passed in the JavaScript
myCheckout.startCheckout(ticket#);
request in order to display the Moneris Checkout page in the browser.
In your server implementation, use the following Moneris Checkout URLs to post to, depending on the development stage:
Testing:
https://gatewayt.moneris.com/chktv2/request/request.phpProduction:
https://gateway.moneris.com/chktv2/request/request.phpTransaction requests are sent to the Moneris Checkout server using JSON.
NOTE: This example reflects a Preload request with all optional objects; the code is for illustrative purposes only and is not executable.
{ "store_id":"moneris", "api_token":"hurgle", "checkout_id":"chkt5BF66neris", "txn_total":"452.00", "environment":"qa", "action":"preload", "token": [ { "data_key": "abc123datakey1", "issuer_id": "645sddfvdrt4tefd" }, { "data_key": "abc123datakey2", "issuer_id": "645sddfvdrt4tefd" }, { "data_key": "abc123datakey3", "issuer_id": "645sddfvdrt4tefd" } ], "ask_cvv":"Y" "order_no":"", "cust_id":"chkt - cust - 0303", "dynamic_descriptor":"dyndesc", "language":"en", "shipping_amount":"200.00", "recur":{ "bill_now":"true", "recur_amount":"1.00", "start_date":"2021-11-21", "recur_unit":"month", "recur_period":"1", "number_of_recurs":"10" }, "cart":{ "items":[ { "url":"https:\/\/example.com\/examples\/item1.jpg", "description":"One item", "product_code":"one_item", "unit_cost":"100.00", "quantity":"1" }, { "url":"https:\/\/example.com\/examples\/item2.jpg", "description":"Two item", "product_code":"two_item", "unit_cost":"200.00", "quantity":"1" }, { "url":"https:\/\/example.com\/examples\/item3.jpg", "description":"Three item", "product_code":"three_item", "unit_cost":"100.00", "quantity":"1" } ], "subtotal":"400.00", "tax":{ "amount":"52.00", "description":"Taxes", "rate":"13.00" } }, "contact_details":{ "first_name":"bill", "last_name":"smith", "email":"test@moneris.com", "phone":"4165551234" }, "shipping_details":{ "address_1":"1 main st", "address_2":"Unit 2012", "city":"Toronto", "province":"ON", "country":"CA", "postal_code":"M1M1M1" }, "billing_details":{ "address_1":"1 main st", "address_2":"Unit 2000", "city":"Toronto", "province":"ON", "country":"CA", "postal_code":"M1M1M1" } }
Variable Name | Type and limits | Description |
---|---|---|
store IDstore_id | String 10-character alphanumeric | Unique identifier provided by Moneris upon merchant account set up |
API tokenapi_token | String 20-character alphanumeric | Unique alphanumeric string assigned upon merchant account activation |
checkout IDcheckout_id | String 30-character alphanumeric (maximum) | Identifies your Moneris Checkout configuration; this is given to you when you configure your page in the Merchant Resource Center |
transaction amounttxn_total | String 10-character decimal Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point | The total dollar amount of the transaction |
developmental modeenvironment | String alphabetic qa or prod | Indicates the stage of development you are sending the request for: testing = qa production = prod |
request typeaction | String alphabetic | Type of request being made to Moneris Checkout server. Allowable values:preload or receipt |
Variable Name | Type and limits | Description |
---|---|---|
order numberorder_no | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | The order number is a unique identified appended to every financial transaction |
customer IDcust_id | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Merchant defined field that can be used as an identifier Searchable from the Moneris Merchant Resource Center |
dynamic descriptordynamic_descriptor | String 20-character alphanumeric < > $ % = \? ^ { } [ ] " total of 22 characters including your merchant name and separator | Merchant-defined description sent on a per-transaction basis that will appear on the credit card statement appen- ded to the merchant’s business name. Dependent on the card issuer, the statement will typically show the dynamic descriptor appended to the merchant's existing business name separated by the "/" character; addi- tional characters will be truncated. NOTE: The 22-character maximum limit must take the "/" into account as one of the characters |
languagelanguage | String 2-character alphabetic | Determines which language Moneris Checkout will display information in Allowable values: en – English fr – French |
data keydata_key | String 25-character alphanumeric | Unique identifier for a Vault profile, and used in future Vault financial transactions to associate a transaction with that profile Data key is generated by Moneris and returned to you in the Receipt object when the profile is first registered. |
prompt for CVVask_cvv | String 1-character alphabetic Y or N | When set to Y, Moneris Checkout will prompt the cardholder to enter their CVV when they select a payment card that has been stored as a token |
shipping amountshipping_amount | String 10-character decimal | Shipping cost of the items to be shipped. |
Moneris Checkout also allows you to send optional objects in the Preload request that reflect additional information entered by the customer at checkout, enable additional features, or meet transaction pro- cessing requirements.
If you have configured Moneris Checkout to handle these additional items, you do not send the cor- responding object in the Preload request. Only send these optional objects if you are using your own e- commerce page to collect them separately from Moneris Checkout.
Variable Name | Type and limits | Description |
---|---|---|
Recurring Billingrecur | Object N/A | Contains fields related to Recurring Billing |
Shopping Cartcart | Object N/A | The virtual shopping cart and its contents |
Contact Detailscontact_details | Object N/A | Customer contact information This object is returned in the Response to Receipt Request as the Customer Information response object ( cust_info) |
Shipping Detailsshipping_details | Object N/A | Customer shipping information |
Billing Detailsbilling_details | Object N/A | Customer billing information |
tokentoken | Array Object N/A | Array object containing between 1 to 3 pairs of a unique data key and an associated issuer ID, each pair representing an instance of a payment card stored in the Moneris Vault Moneris Checkout will accept a maximum three token pairs of data key and issuer ID for each customer |
Include this object in Preload request to indicate the start of a series of Recurring Billing transactions that will be managed by Moneris.
recur
Variable Name | Type and limits | Description |
---|---|---|
number of recursnumber_of_recurs | String numeric 1-999 | The number of times that the transaction must recur |
periodrecur_period | String numeric 1-999 | Number of recur unit intervals that must pass between recurring billings |
recurring amountrecur_amount | String 10-character decimal, minimum three digits Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point EXAMPLE: 1234567.89 | Dollar amount of the recurring transaction. This amount will be billed on the start date, and then billed repeatedly based on the interval defined by period and recur unit. |
recur unitrecur_unit | String day, week, month or eom | Unit to be used as a basis for the interval. Works in conjunction with the period variable to define the billing frequency. |
start datestart_date | String YYYY/MM/DD format | Date of the first future recurring billing transaction; this must be a date in the future. If an additional charge will be made immediately, the start now variable must be set to true. |
bill nowbill_now | Stringtrue or false | Set to true if a charge will be made against the card immediately; otherwise set to false. |
The shopping cart object can contain multiple items (each item is represented as its own array within the Shopping Cart object).
cart
Variable Name | Type and limits | Description |
---|---|---|
shopping cart itemsitems | Object sub-object containing arrays, nested within cart contains following items in blue | Encapsulates the entire array of items in the shopping cart |
URLitems.url | String alphanumeric | URL that corresponds to the image Moneris Checkout shopping cart item |
descriptionitems.description | String 200-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Describes the item in the shopping cart |
product codeitems.product_code | String 50-character decimal Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | The SKU for the item |
unit costitems.unit_cost | String 10-character decimal Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point EXAMPLE: 1234567.89 | Per-unit cost of the item |
quantityitems.quantity | String numeric 6 characters maximum | Number of individual instances of the given item in the shopping cart |
subtotalsubtotal | String 10-character decimal Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point EXAMPLE: 1234567.89 | Total dollar amount of the shopping cart, before taxes |
taxtax | Object sub-object nested within cart contains following items in blue | Contains information related to taxes charged on the items in the shopping cart. |
tax amounttax.amount | String 10-character decimal Up to 7 digits (dollars) + decimal point (.) + 2 digits (cents) after the decimal point EXAMPLE: 1234567.89 | Dollar amount of taxes |
tax descriptiontax.description | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Describes type of tax being applied |
tax ratetax.rate | String Must be a numer wth up to 3 decimal places EXAMPLE: xx or xx.x or xx.xx or xx.xxx | Percentage tax rate charged |
contact_details
Variable Name | Type and limits | Description |
---|---|---|
first namefirst_name | String 30-character alphanumeric | Customer first name |
last namelast_name | String 30-character alphanumeric | Customer last name |
e-mailemail | String 255-character alphanumeric | Customer email |
phone numberphone | String 30-character alphanumeric | Customer phone number |
shipping_details
Variable Name | Type and limits | Description |
---|---|---|
shipping address line 1address_1 | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Customer shipping address |
shipping address line 2address_2 | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Customer shipping address |
shipping citycity | String 50-character alphanumeric | Customer shipping address city |
shipping provinceprovince | String 2-character alphanumeric | Customer shipping address province. Country subdivision ISO 3166-2 |
shipping countrycountry | String 2-character alphanumeric | Customer shipping address country ISO 3166-1 alpha-2 |
shipping postal codepostal code | String 20-character alphanumeric NOTE: some special characters are not allowed | Customer shipping address postal code |
NOTE: Billing-related fields are required when sending 3-D Secure authentication transactions, or else the authentication process may fail.
billing_details
Variable Name | Type and limits | Description |
---|---|---|
billing address line 1address_1 | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Customer billing address |
billing address line 2address_2 | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Customer shipping address |
billing citycity | String 50-character alphanumeric Note: some special characters are not allowed < > $ % = \? ^ { } [ ] " | Customer billing address city |
billing provinceprovince | String 3-character alphanumeric | Customer billing address province. Country subdivision ISO 3166-2 |
billing countrycountry | String 2-character alphanumeric | Customer billing address country ISO 3166-1 alpha-2 |
billing postal codepostal code | String 20-character alphanumeric | Customer billing address postal code |
//Successful Preload: { "response":{ "success":"”true”", "ticket":"1585G9G9GIKKGGGIGIOG09G9OGKGJFKFJFNjuit8g9" } } //Failed Preload { "response":{ "success":"”false”", "error":{ "billing_details":{ "data":"”billing address must be set when AVS is enabled”" } } } }
Variable Name | Type | Description |
---|---|---|
response "response": | String N/A | Top level response object |
success "success": | boolean N/A | Denotes whether the Preload request was successful |
ticket "ticket": | String | Identifies the specific Moneris Checkout instance Only returned if success = true |
error "error": | String | Sub-object that encapsulates all errors that occurred as a result of the Preload request Only returned if success = false |
data "data": | String | Describes the specific type of error that occurred as a result of some aspect of the Preload request |
When a customer goes to check out their items for purchase, the Moneris Checkout page is displayed in the <div> tag you created on your web site.
To insert the Moneris Checkout instance into the <div>, you call the JavaScript function:
myCheckout.startCheckout("");
Once the Payment Complete callback has been called, your merchant website can make the server-to-server Receipt Request call in order to obtain the details of the transaction for the receipt and to determine whether the transaction was approved or declined.
In your server implementation, use the following Moneris Checkout URLs to post to, depending on the development stage:
Testing:
https://gatewayt.moneris.com/chktv2/request/request.phpProduction:
https://gateway.moneris.com/chktv2/request/request.php{ "store_id": "example_storeId", "api_token": "example_apiToken", "checkout_id": "example_checkoutId", "ticket": "1539966660vfTyEASfnwNrsQqFE8VkMAOcN169zt", "environment": "qa", "action": "receipt" }
Once the transaction is finished, you can request the receipt details from the Moneris Checkout server.
Variable Name | Type and limits | Description |
---|---|---|
store IDstore_id | String N/A | Unique identifier provided by Moneris upon merchant account set up |
API tokenapi_token | String N/A | Unique alphanumeric string assigned upon merchant account activation |
checkout IDcheckout_id | String 30-character alphanumeric (maximum) | Identifies your Moneris Checkout configuration; this is given to you when you configure your page in the Merchant Resource Center |
ticket numberticket | String maximum 50-character alphanumeric | The unique ticket number that identifies a particular transaction; this returned in the response to the Preload request |
developmental modeenvironment | String alphabetic | Indicates the stage of development you are sending the request for: testing = qa production = prod |
request typeaction | String alphabetic | Type of request being made to Moneris Checkout server. Allowable values:preload or receipt |
Responses to Receipt Requests can contain multiple, nested response objects.
The following are fields that may be returned in the Response to Receipt Request, shown with nesting
Variable Name | Description |
---|---|
response{"response":{ | Top level response object |
"success": | Denotes whether request was successful (i.e., approved, declined) Unsuccessful means error or could not process Possible values: true or false |
"request":{ | Contains information relating to the Preload request and other information that Moneris Checkout sends to the Moneris Gateway when processing the financial transaction |
"receipt":{ | Object containing the receipt information |
NOTE: Not all features in Moneris Checkout are supported simultaneously, and therefore some objects would not actually appear in the response at the same time in a real-world scenario; response code below is provided for illustrative purposes only.
{ "response":{ "success":"true", "request":{ "txn_total":"6.00", "cust_info":{ "first_name":"bill", "last_name":"smith", "phone":"4165551234", "email":"test@moneris.com" }, "shipping":{ "address_1":"1 main st", "address_2":"Unit 2012", "city":"Toronto", "country":"Ca", "province":"On", "postal_code":"M1M1M1" }, "billing":{ "address_1":"1 main st", "address_2":"Unit 2000", "city":"Toronto", "province":"ON", "country":"CA", "postal_code":"M1M1M1" }, "recur":{ "number_of_recurs":"3", "recur_period":"1", "recur_amount":"15.00", "recur_unit":"month", "start_date":"20220902", "bill_now":"false" }, "cart":{ "items":[ { "url":"https:\/\/esqa.moneris.com\/cr\/checkout\/item3.jpg", "description":"Three item", "product_code":"two_item", "unit_cost":"11.00", "quantity":"1" } ], "subtotal":"10.24", "tax":{ "amount":"0.00", "description":"Tax", "rate":"0" } }, "cc_total":"6.00", "cc":{ "first6last4":"4242424242", "expiry":"1221", "cardholder":"test", }, "mcp":{ "merchant_settlement_amount":"452.00", "cardholder_currency_code":"978" }, "gift":[ { "balance_remaining":"0.00", "Description":"Gift Fixed Reload", "first4last4":"************0214", "pan":"0211020000001000214", "cvd":"123", "balance_used":"200.00" } ], "wallet":{ "type":"applepay", "paymentData":{ "token":{ "paymentData":{ "data":"0YJMuivQ6+xILNQyDfwO+kzKWZ//TkNa5nxBzHIf7fw==", "signature":"MIAGCSqGSIb3DJ7mrwhISSB+Ic6kAAAAAAAA=", "header":{ "publicKeyHash":"18hkrHSrxIdbZs5qKY4US8bFqEk6bBGXde14yQrwrd8=", "ephemeralPublicKey":"MFkwEwYHKoZIzj0h6ilzF+Z4dseqHDjsdYA==", "transactionId":"4c0d6ae158aa0322b1f5baf6467195e0238ca48f" }, "version":"EC_v1" }, "paymentMethod":{ "displayName":"Discover 2780", "network":"Discover", "type":"credit" }, "transactionIdentifier":"4C0D6AE158AA03CC4BAF6467195E0238CA48F" } } }, "ticket":"1635780027iwm4IczLlO2LqHQ6xHmvDJ1xFIS2vT", "cust_id":"chkt- cust -1101", "dynamic_descriptor":"dyndesc", "order_no":"20211101152026", "eci":"7" }, "receipt":{ "result":"a", "gift":[ { "order_no":"1583250405Ad1BmCSsfHHDeu4_g1", "transaction_no":"6198-1583250435590-00157838_15", "reference_no":"3276071", "response_code":"000", "benefit_amount":"200.00", "benefit_remaining":"0.00", "first6last4":"0211020214" } ], "cc":{ "order_no":"20211101152026", "cust_id":"chkt- cust -1101", "transaction_no":"8291-0_20", "reference_no":"660115340017373030", "transaction_code":"00", "transaction_type":"200", "transaction_date_time":"2021-11-01 11:20:53", "corporate_card":null, "amount":"6.00", "response_code":"027", "iso_response_code":"01", "approval_code":"489642", "card_type":"V", "dynamic_descriptor":"dyndesc", "invoice_number":null, "customer_code":null, "eci":"7", "cvd_result_code":"1M", "avs_result_code":"null", "cavv_result_code":null, "first6last4":"4242424242", "expiry_date":"1221", "recur_success":"null", "issuer_id":null, "is_debit":null, "advice_code":"40", "ecr_no":"66011534", "batch_no":"737", "sequence_no":"303", "result":"a", "cf_success":"true", "cf_fee_amt":"0.11", "cf_fee_rate":"1.75", "cf_fee_type":"PCT", "cf_status":"2", "tokenize":{ "success":"true", "first4last4":"2222***0011", "datakey":"4sbe08wFMEePj4632EVIbWNL2", "status":"001", "message":"Successfully updated CC details." }, "mcp":{ "merchant_settlement_amount":"452.00", "cardholder_currency_code":"978", "mcp_rate":"1.508", "decimal_precision":"2", "cardholder_amount":"299.73", "cardholder_currency_desc":"EUR" }, "fraud":{ "3d_secure":{ "decision_origin":"Merchant", "result":"3", "condition":"1", "status":"disabled", "code":"", "details":"" }, "kount":{ "decision_origin":"Merchant", "result":"3", "condition":null, "status":"disabled", "code":"", "details":"" }, "avs":{ "decision_origin":"Merchant", "result":"3", "condition":"0", "status":"disabled", "code":"", "details":"" }, "cvd":{ "decision_origin":"Merchant", "result":"1", "condition":"0", "status":"success", "code":"1M", "details":"" } }, "vault_data":[ { "data_key":"JNDSFQKD8iRsCQM5TcBObz9V7", "is_valid":"true" }, { "data_key":"4jZb8X1gCpWfC4f4KKh6Fizf2", "is_valid":"true" }, { "data_key":"jjq6xx5cUQsS1AhwaQhNYpKG8", "is_valid":"true" } ] } } } }
To terminate the Moneris Checkout instance, call myCheckout.closeCheckout(), for example:
myCheckout.closeCheckout(" ");
Callbacks are the means by which Moneris Checkout communicates with your merchant checkout page. All callbacks include a single parameter defined as a JSON-formatted string.
In order to handle callbacks, you need to create JavaScript functions that receive the callbacks being sent by Moneris Checkout when the events occur. These functions are linked to the callbacks you set earlier when you prepared your site's checkout page, as described in the Client-Side Checkout Page section.
These callbacks are required to be included in the JavaScript of your page:
Variable Name | Type and limits | Description |
---|---|---|
handlerhandler | String alphanumeric | Describes the type of callback being used. Possible values: cancel_transaction error_event page_loaded payment_complete payment_receipt |
ticketticket | String alphanumeric | Identifies the specific Moneris Checkout instance This is also returned in the response to the original Preload |
response coderesponse_code | String alphanumeric | Identifies the result of the callback. For information on response codes, see Callback Response Codes – Moneris Checkout |
To get the page loaded status of the Moneris Checkout page.
This callback is called once the Moneris Checkout is loaded.
JavaScript Set Method for Callback:
myCheckout.setCallback("page_loaded",myPageLoad);
JSON Response Message Format:
{
"handler": "page_loaded",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "001"
}
This callback is called in the event the cardholder presses the cancel button in Moneris Checkout.
Standard is to call the closeCheckout() method to close the Moneris Checkout <div>.
The closeCheckout( ) method will need to be called and a new Preload request will be required in order to initiate a new Moneris Checkout instance.
JavaScript Set Method for Callback:
myCheckout.setCallback("cancel_transaction",myCancelTransaction);
JSON Response Message Format:
{
"handler": "cancel_transaction",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "001"
}
When an error occurs during the checkout process. This requires the Moneris Checkout session to be closed using the closeCheckout function
To attempt the transaction again, a new Preload request must be sent to the Moneris Checkout server in order to get a new transaction ticket number.
JavaScript Set Method for Callback:
myCheckout.setCallback("error_event",myErrorEvent);
JSON Response Message Format:
{
"handler": "error_event",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "902"
}
Transaction is complete and receipt is ready to be collected.
If you have chosen to have Moneris Checkout generate the receipt, this callback is called once the Mon- eris Checkout displays the transaction receipt.
If you have chosen Moneris Checkout not to generate a receipt, this callback will not be called. For information on when to obtain the receipt response for the transaction, refer to the Payment Complete callback.
JavaScript Set Method for Callback:
myCheckout.setCallback("payment_receipt",myPaymentReceipt);
JSON Response Message Format:
{
"handler": "payment_receipt",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "001"
}
This callback is called once Moneris Checkout has completed payment.
If you have chosen Moneris Checkout to generate a receipt, the cardholder has to return to your Checkout page in order for the callback to be called.
For information on obtaining the receipt response for the transaction, refer to the Payment Receipt callback .
Moneris Checkout should be closed by calling the closeCheckout() method
JavaScript Set Method for Callback:
myCheckout.setCallback("payment_complete",myPaymentComplete);
JSON Response Message Format:
{
"handler": "payment_complete",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "001"
}
This callback is called when user is on payment page and try to
Moneris Checkout should be closed by calling the closeCheckout() method We will continue with the payment. No changes to the payment flow.
JavaScript Set Method for Callback:
myCheckout.setCallback("page_closed",myPageClosed);
JSON Response Message Format:
When User close window, Browser back button or Reload Button.
{
"handler": "page_closed",
"response_code": "001"
}
When Javascript Error Occur
{
"handler": "page_closed",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "001"
}
This callback is called will be triggered when cardholder clicks Checkout button and payment processing is started.
JavaScript Set Method for Callback:
myCheckout.setCallback("payment_submitted",myPaymentSubmitted);
JSON Response Message Format:
{
"handler": "payment_submitted",
"ticket": "1539961059DdrvGG3Yj7rxvMAgvRlc4nqKXF7YjT",
"response_code": "001"
}
RESPONSE CODE | REASON |
---|---|
001 | Success |
902 | 3-D Secure failed on response |
2001 | Invalid ticket |
2002 | Ticket re-use |
2003 | Ticket expired |
In the testing stage of development:
<script src="https://gatewayt.moneris.com/chktv2/js/chkt_v2.00.js"></script>
myCheckout.setMode("qa");
Test card numbers are available for testing your Moneris Checkout integration. For the most current test
card information, see the Moneris developer portal at:
Special information for testing convenience fee/service fee:
For testing transactions with convenience fee/service fee in Moneris Checkout, you must use the specific test credentials:
Store ID: monca00392
Username: DemoUser
Password: password
Once you have finished testing your Moneris Checkout integration, do the following to move the integration into production:
<script src="https://gateway.moneris.com/chktv2/js/chkt_v2.00.js"></script>
myCheckout.setMode("prod");